﻿<Page x:Class="SponsorshipManager.Client.View.Welcome"
	  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	  xmlns:conv="clr-namespace:SponsorshipManager.Client.Converters"    
	  xmlns:ctrl="clr-namespace:SponsorshipManager.Client.Controls;assembly=Controls"    
      xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
	Title="Welcome to Sponsorship Manager">
	<Page.Resources>
		<conv:LoginPromptVisibility x:Key="LoginPromptVisibility"/>
		<conv:UserLoggedInVisibility x:Key="UserLoggedInVisibility"/>
        
    </Page.Resources>
    <StackPanel Margin="50,0">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Image Grid.Row="0" Grid.Column="0"  Source="{Binding Path=LoginImage}"/>
            <TextBlock Grid.Row="0" Grid.Column="1" FontSize="16" VerticalAlignment="Center" Visibility="{Binding Path=VisibleWhenNotLoggedIn}">
			    <Hyperlink NavigateUri="Login.xaml">Please log in.</Hyperlink>
            </TextBlock>
            <TextBlock VerticalAlignment="Center" Margin="0,0,50,0">
                <Run Text="{Binding Path=UserDetails.Name}"/>
                <Run Text="{Binding Path=UserDetails.Surname}"/>
                <LineBreak/>
                <Run Text="{Binding Path=UserDetails.Email}"/>
            </TextBlock>
            
            <ctrl:ImageButton ImageSource="/ClientApplication;component/Resources/images/Person_Details_64.png" 
                Grid.Column="2" 
                Visibility="{Binding Path=VisibleWhenLoggedIn}" 
                Content="Log In"/>

            <Button Grid.Column="3" Visibility="{Binding Path=VisibleWhenLoggedIn}" Margin="5" >
                <StackPanel Orientation="Horizontal">
                    <Image Height="32" Margin="5" Source="/ClientApplication;component/Resources/images/Person_Details_64.png"/>
                    <TextBlock  Margin="5" VerticalAlignment="Center" TextAlignment="Center">My Details</TextBlock>
                </StackPanel>
            </Button>
        </Grid>
        <Grid Visibility="{Binding Path=VisibleWhenLoggedIn}" Margin="0,50,0,0">
		    <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
		    </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBox Grid.Column="0" Margin="0,0,50,0"
                VerticalAlignment="Center" FontSize="20">Search For...</TextBox>
            <Button Grid.Column="1">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Image Height="32" Margin="5" Source="/ClientApplication;component/Resources/images/Search_64.png"/>
                    <TextBlock  Margin="5" VerticalAlignment="Center" TextAlignment="Center">Search</TextBlock>
                </StackPanel>
            </Button>
            <TextBlock Grid.Row="1" Grid.Column="0" Margin="10">
                <Hyperlink>Advanecd Search</Hyperlink>
            </TextBlock>            
        </Grid>
        <Grid Visibility="{Binding Path=VisibleWhenLoggedIn}" Margin="0,50,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Label Grid.Column="0">Create:</Label>
            <StackPanel Grid.Column="1" Orientation="Horizontal" >
                <Button Visibility="{Binding Path=VisibleWhenLoggedIn}" Margin="5" >
                    <StackPanel Orientation="Horizontal">
                        <Image Height="32" Margin="5" Source="/ClientApplication;component/Resources/images/Child_64.png"/>
                        <TextBlock  Margin="5" VerticalAlignment="Center" TextAlignment="Center">New Child</TextBlock>
                    </StackPanel>
                </Button>
                <Button Visibility="{Binding Path=VisibleWhenLoggedIn}" Margin="5" >
                    <StackPanel Orientation="Horizontal">
                        <Image Height="32" Margin="5" Source="/ClientApplication;component/Resources/images/User_64.png"/>
                        <TextBlock  Margin="5" VerticalAlignment="Center" TextAlignment="Center">New User</TextBlock>
                    </StackPanel>
                </Button>
                <Button Visibility="{Binding Path=VisibleWhenLoggedIn}" Margin="5" >
                    <StackPanel Orientation="Horizontal">
                        <Image Height="32" Margin="5" Source="/ClientApplication;component/Resources/images/Add_64.png"/>
                        <TextBlock  Margin="5" VerticalAlignment="Center" TextAlignment="Center">New Sponsor</TextBlock>
                    </StackPanel>
                </Button>
                <Button Visibility="{Binding Path=VisibleWhenLoggedIn}" Margin="5" >
                    <StackPanel Orientation="Horizontal">
                        <Image Height="32" Margin="5" Source="/ClientApplication;component/Resources/images/Family_64.png"/>
                        <TextBlock  Margin="5" VerticalAlignment="Center" TextAlignment="Center">New Family</TextBlock>
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
<!--
        <Label Grid.Row="2" Grid.Column="0">:</Label>
            
            <Label Grid.Row="3" Grid.Column="0">Correspondence:</Label>
            <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" Visibility="{Binding Path=VisibleWhenLoggedIn}">
                <Button Visibility="{Binding Path=VisibleWhenLoggedIn}" Margin="5" >
                    <StackPanel Orientation="Horizontal">
                        <Image Height="32" Margin="5" Source="/ClientApplication;component/Resources/images/Family_64.png"/>
                        <TextBlock  Margin="5" VerticalAlignment="Center" TextAlignment="Center">New Letter</TextBlock>
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
        -->
    </StackPanel>
</Page>
	
	
